package jtk.project4.fleet.field;



import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.MemoField;
import nl.coderight.jazz.form.field.TextField;

public class EditTireHistoryField extends GroupControl{
	private ComboField<String> tireServiceField;
	private ComboField<String> axleField;
	private ComboField<String> positionField;
	private ComboField<String> costCenterField;
	private TextField costField;
	private MemoField commentField;
	
	public EditTireHistoryField(String bindID){
		//setTitle("header.TireHistoryField");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		costField = new TextField ("Cost", 25);
		costField.setRequired(true);
		commentField = new MemoField("Comments");
		commentField.setRows(3);
		tireServiceField = new ComboField<String>("Tire Service","Tire Service");
		tireServiceField.setPreferredSize(new Dimension(166,20));
		axleField = new ComboField<String>("Axle","Axle");
		axleField.setPreferredSize(new Dimension(166,20));
		positionField = new ComboField<String>("Position","Position");
		positionField.setPreferredSize(new Dimension(166,20));
		costCenterField = new ComboField<String>("Cost Center","Cost Center");	
		costCenterField.setPreferredSize(new Dimension(166,20));
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("label.tireService")		.addField(tireServiceField)
		.addRow()
		.addLabel("label.axle")				.addField(axleField)
		.addRow()
		.addLabel("label.position")			.addField(positionField)
		.addRow()
		.addLabel("label.costCenter")		.addField(costCenterField)
		.addRow()
		.addLabel("label.cost")				.addField(costField)
		.addRow()
		.addLabel("label.comment")			.addField(commentField)
		.addRow()
		;
	}
}